/* 
  消息通知集合
*/
import { Schema, SchemaFactory, Prop } from '@nestjs/mongoose'
import mongoose, { Document } from 'mongoose'

export type informDocument = Inform & Document

@Schema({ timestamps: true })
class Inform {
  //通知的用户
  @Prop({ required: true, ref: 'User' })
  informUser: mongoose.Types.ObjectId
  //评论id
  @Prop({ default: null, ref: 'Comment' })
  comment: mongoose.Types.ObjectId

  //添加你的用户
  @Prop({ default: null, ref: 'User' })
  friend: mongoose.Types.ObjectId
  //是否阅读通知
  @Prop({ default: false })
  isLook: boolean
}

const informSchema = SchemaFactory.createForClass(Inform)

export { Inform, informSchema }
